import { Book, Comment, User } from '../models';

export default function (router) {
  router.get('/api/admin/stat/nums', async (ctx) => {
    const totalBook = await Book.countDocuments();
    const totalComment = await Comment.countDocuments();
    const totalUser = await User.countDocuments();
    await ctx.json(true, '获取数据统计成功', { book: totalBook, comment: totalComment, user: totalUser });
  });
}
